<?php

namespace Registro\Models;


/**
 * RememberTokens
 * Stores the remember me tokens
 */
class RememberTokens extends \Registro\Models\BaseModel {

    /**
     *
     * @var integer
     */
    public $token_id;

    /**
     *
     * @var integer
     */
    public $token_user_id;

    /**
     *
     * @var string
     */
    public $token;

    /**
     *
     * @var string
     */
    public $token_useragent;

    /**
     *
     * @var integer
     */
    public $token_created;
    
    /**
     * Before create the user assign a password
     */
//    public function beforeValidationOnCreate()
//    {
//        // Timestamp the confirmaton
//        $this->token_created = time();
//    }

    public function initialize()
    {
        $this->_entity = 'token_';
        $this->belongsTo( 'token_user_id', 'Vokuro\Models\Users', 'user_id', array(
            'alias' => 'user'
        ) );
    }

}
